<?php
namespace App\Http\Service\User;


use App\Http\Service\Basic\BasicService;
use Config;

class UserService extends BasicService
{

    //构造函数
    function __construct()
    {
        parent::__construct();
    }


    //登录
    public function login($where = array())
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.login'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.login'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }
    //退出登录
    public function logout($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.logout'),$where, 'get');
    }

    //账号列表
    public function getAccountList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_account_list'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_account_list'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    //   添加账号
    public function addAccount($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.add_account'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.add_account'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    //获取账号在线信息
    public function getAccountOnlineInfo($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_account_online_info'),$where, 'get');

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_account_online_info'),$where, 'get');

    }



    //  账号禁用
    public function forbiddenAccount($where)
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.forbidden_account'),$where, 'get');

    }


    
    //   更新账号
    public function updateAccount($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_account'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_account'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }



    public function getBillList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.bill_list'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.bill_list'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }



}